package operatebag;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class namefind extends JFrame {
    public JTextField text;
    public JLabel label;
    public JButton button;
    public JFrame jf;
    public namefind(int u){
        setTitle("查找学生");
        setLayout(new FlowLayout());
        setBounds(300,100,400,400);
        setResizable(false);
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);

        label=new JLabel("信息");
        text=new JTextField(10);
        button=new JButton("确定");
        jf=this;
        add(label);
        add(text);
        add(button);
        button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                    String data=text.getText();
                try {
                    new commonsgow(data,u);
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
                }
                jf.dispose();

            }
        });
        setVisible(true);
    }
}
